const { resolve } = require("path");

function sum1(a, b) {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve(a + b)
        }, 2000);
    })
}

async function sum(a, b) {
    return setTimeout(() => {
        sum(a + b)
    }, 2000)

}

async function fn() {
    let result
    try {
        result = await sum(1, 2)
        console.log(result);
    }
    catch {
        console.log("GG");
    }

}
fn()

